<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //获取访问路径
    var a = 'http://item.taobao.com/item.htm?a=1&b=2&c=&d=shmhm'
    var result = a.replace(/&/g, '","').replace(/=/g, '":"');
    //console.log(result)
    var reqDataString = '{"' + result + '"}';
    //console.log(reqDataString)
    var valueRe = JSON.parse(reqDataString);
    console.log(valueRe)
  </script>
</body>

</html>